home *** CD-ROM | disk | FTP | other *** search
/ Champak 142 / Volume 142 Oct 17 2011 - Damaged.iso / Games / parasite-x.swf / scripts / frame_22 / DoAction.as < prev   
Text File  |  2011-10-17  |  2KB  |  87 lines

  1. stop();
  2. _root.delay = 100;
  3. _root.time1 = 0;
  4. _root.lives = 30 + _root.liveup;
  5. _root.leveltime = 89 * _root.level1;
  6. _root.combo = 1;
  7. _root.spawn = 6;
  8. _root.days = _root.houres * 0.0422;
  9. _root.fire = 0;
  10. _root.Test._y = 927.5;
  11. _root.Test._x = 250.3;
  12. _root.Test._yscale = 4.6 + _root.sizeup;
  13. _root.Test._xscale = 4.6 + _root.sizeup;
  14. _root.Test2._yscale = 34 + _root.sizeup2;
  15. _root.Test2._xscale = 47 + _root.sizeup2;
  16. onMouseDown = function()
  17. {
  18.    if(_root.delay >= 30 - _root.firerate)
  19.    {
  20.       bomb = attachMovie("bomb","bomb",_root.getNextHighestDepth());
  21.       bomb._y = Test._y;
  22.       bomb._x = Test._x;
  23.       bomb._yscale = _root.bombsize;
  24.       bomb._xscale = _root.bombsize;
  25.       _root.delay = 0;
  26.    }
  27. };
  28. onEnterFrame = function()
  29. {
  30.    if(_root.gamepaused == 0)
  31.    {
  32.       bomb.play();
  33.    }
  34.    else
  35.    {
  36.       bomb.stop();
  37.    }
  38.    _root.delay += 0.1;
  39.    draw.clear();
  40.    i = 0;
  41.    while(i < length)
  42.    {
  43.       me = this["line" + i];
  44.       if(i == 0)
  45.       {
  46.          tx = _root.Test._x;
  47.          ty = _root.Test._y;
  48.       }
  49.       else
  50.       {
  51.          tx = this["line" + (i - 1)]._x;
  52.          ty = this["line" + (i - 1)]._y;
  53.       }
  54.       xdiff = (tx - me._x) / speed;
  55.       ydiff = (ty - me._y) / speed;
  56.       if(Math.abs(xdiff) > 1)
  57.       {
  58.          me._x += xdiff;
  59.       }
  60.       if(Math.abs(ydiff) > 1)
  61.       {
  62.          me._y += ydiff;
  63.       }
  64.       me._x += wind;
  65.       me._y += gravity;
  66.       draw.lineStyle(length - i,16777215,100);
  67.       draw.moveTo(me._x,me._y);
  68.       draw.lineTo(tx,ty);
  69.       me.swapDepths(1);
  70.       _root.Test.swapDepths(999);
  71.       i++;
  72.    }
  73. };
  74. var keyListener = new Object();
  75. keyListener.onKeyDown = function()
  76. {
  77.    if(_root.ammo > 499)
  78.    {
  79.       _root.ammo -= 30;
  80.       bomb = attachMovie("bomb","bomb",_root.getNextHighestDepth());
  81.       bomb._y = Test._y;
  82.       bomb._x = Test._x;
  83.       bomb._rotation = Test._rotation;
  84.    }
  85. };
  86. Key.addListener(keyListener);
  87.